package com.dyna.auth.controller;

import com.dyna.api.domain.resp.SysOAuth2AccessTokenCheckResp;
import com.dyna.api.feign.AuthTokenApi;
import com.dyna.auth.service.TokenService;
import com.dyna.domain.resp.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zhoucaiwang
 * @date 2023/8/15
 */

@Api(value = "基础模块/token相关")
@RestController
@RequestMapping(value = "/token")
public class TokenController implements AuthTokenApi {

    @Resource
    private TokenService tokenService;

    @Override
    @ApiOperation(value = "验证令牌")
    @RequestMapping("/check")
    public R<SysOAuth2AccessTokenCheckResp> checkAccessToken(String accessToken) {
        return tokenService.checkAccessToken(accessToken);
    }


}
